import Vue from 'vue'
import App from './App.vue'
import router from './views/router'
import store from './store'
import '@/icons'
import '@/utils/promiseBtns'
import '@/utils/editor'
import Antd from 'ant-design-vue'
import '@/assets/styles/antd.less'
import _ from 'lodash'
import xss from 'xss'
import '@/utils/sysEvt/sysEvtBus'
Window._ = _
import moment from 'moment'
import { Empty } from 'ant-design-vue'
import 'moment/locale/zh-cn'
moment.locale('zh-cn')
import filters from '@/utils/filters'
import { message, notification } from 'ant-design-vue'
import req from './common/request'
import { download } from './utils/methods'
import MFilter from '@/components/filter'
import contentHeader from '@/components/content-header'
import config from '@/common/config'
import specialPlugin from './components/special/index'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css' // 默认主题
import 'simply-ellipsis/example/ellipsis.css'

import i18n from './locales'
import 'echarts'
import ECharts from 'vue-echarts'
// import ellipsis from 'simply-ellipsis'
// import 'simply-ellipsis/example/ellipsis.scss'
// ellipsis.setObserver('app')

Vue.use(ElementUI)
Vue.use(specialPlugin)
MFilter.install = function (Vue) {
    Vue.component(MFilter.name, MFilter)
}
contentHeader.install = function (Vue) {
    Vue.component(contentHeader.name, contentHeader)
}

const plugins = {}
plugins.install = vue => {
    Vue.prototype.xss = xss
    Vue.prototype.$config = config
    Vue.prototype.download = download
    vue.prototype.$moment = moment
    vue.prototype.emptySimpleImage = Empty.PRESENTED_IMAGE_SIMPLE
    Vue.prototype.$filters = filters
    Vue.prototype.$message = message
    Vue.prototype.$notification = notification
    Vue.prototype.$notification401 = req.notification401
    Vue.prototype.idColumn =
        process.env.NODE_ENV === 'development'
            ? [
                  {
                      title: 'ID',
                      dataIndex: 'id',
                  },
              ]
            : []
}
Vue.use(plugins)
Vue.use(Antd)
Vue.use(MFilter)
Vue.use(contentHeader)
Vue.config.productionTip = false

Vue.component('v-chart', ECharts)

new Vue({
    router,
    store,
    i18n,
    render: h => h(App),
}).$mount('#app')
